//
//  LTView.m
//  AddressBookCoreData
//
//  Created by dllo on 15/11/20.
//  Copyright © 2015年 Dior_3g. All rights reserved.
//

#import "JHCLTView.h"

#define WIDTH self.frame.size.width
#define HEIGHT self.frame.size.height

@implementation JHCLTView

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        [self createLTView];
    }
    return self;
}

- (void)createLTView {
    
    self.backgroundColor = [UIColor whiteColor];

    self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, HEIGHT / 10, WIDTH / 5 * 2, HEIGHT / 10 * 8)];
    [self addSubview:self.label];
    self.label.layer.cornerRadius = 10;
    self.label.backgroundColor = [UIColor cyanColor];
    self.label.layer.masksToBounds = YES;
    self.label.textAlignment = 1;
    
    
    self.textField = [[UITextField alloc] initWithFrame:CGRectMake(WIDTH / 5 * 2, HEIGHT / 10, WIDTH / 5 * 3, HEIGHT / 10 * 8)];
    [self addSubview:self.textField];
    self.textField.layer.masksToBounds = YES;
    self.textField.layer.cornerRadius = 10;
    self.textField.backgroundColor = [UIColor grayColor];
    
    self.textField.delegate = self;
    
}


- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    
    [self.textField resignFirstResponder];
    return  YES;
    
}

@end
